home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1604 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.6 KB

  1. Path: newsroom.hitc.com!usenet
  2. From: psand@eos.hitc.com (G. Patrick Sand)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: newbie ? on inheritance in VC++
  5. Date: 11 Jan 1996 21:07:44 GMT
  6. Organization: Hughes Aircraft (EOSDIS)
  7. Message-ID: <4d3u70$6bh@newsroom.hitc.com>
  8. References: <30F46027.15FB@cell.cinvestav.mx>
  9. NNTP-Posting-Host: 155.157.118.56
  10. Mime-Version: 1.0
  11. X-Newsreader: WinVN 0.99.3
  12.  
  13. In article <30F46027.15FB@cell.cinvestav.mx>, hhemken@cell.cinvestav.mx 
  14. says...
  15.  
  16. >= = = = = = = = = = Code Fragment = = = = = = = = = = = = = = = = = =
  17. >
  18. >class C_Item
  19. >{
  20. > protected:
  21. >  C_Item    *Previous;      // address of previous C_Item
  22. >  C_Item    *Next;          // address of next C_Item
  23. > public:
  24. >  C_Item();
  25. >  ~C_Item();
  26. >  C_Item    *Attach(C_Item *ItemPointer);
  27. >  C_Item    *Detach(void);
  28. >};
  29. >// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  30. >// C_List is the base class of a C_List of listable items derived from
  31. >C_Item
  32. >
  33. >class C_List : public C_Item
  34. >{
  35. > private:
  36. >  C_Item    *ListHead;      // C_List head
  37. >  C_Item    *CurrentItem;   // Current C_Item
  38. >
  39. (Rest deleted for brevity)
  40.  
  41. You appear to be using both inheritence (...: public C_Item...) and 
  42. membership (...private:  CItem *...).  I suggest you drop the inheritence 
  43. and try again.
  44.  
  45. -- 
  46. G. Patrick Sand
  47. psand@eos.hitc.com
  48. PatSand@aol.com
  49. (301) 925-0791
  50. "Travel Light But Right..."
  51. Microsoft Network is prohibited from redistributing 
  52. this work in any form, in whole or in part.   License 
  53. to distribute this individual post is available to Microsoft
  54. for $999. Posting without permission constitutes an 
  55. agreement to these terms...gps
  56.  
  57.